<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AlterShopAchivesAddSelfDelivary extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('shop_archives', function (Blueprint $table) {
            $table->unsignedTinyInteger('isOpenSelfDelivery')->default(0)->after('createdAt')->comment('是否开启自配送');
            $table->text('selfDeliveryNotice')->default('')->after('createdAt')->comment('自配送公告');
            $table->unsignedInteger('minSelfDeliveryPrice')->default(0)->after('createdAt')->comment('自配送起送金额');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('shop', function (Blueprint $table) {
            $table->dropColumn('isOpenSelfDelivery');
            $table->dropColumn('selfDeliveryNotice');
            $table->dropColumn('minSelfDeliveryPrice');
        });
    }
}
